<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<div id="header">
	<!-- ============== HEADER ================== -->
	<div class="welcome">
		<s:if test="%{#session.lastname == null}">
		Welcome, <a href="<s:url action="loginpage" namespace="/" />">Guest</a>
		</s:if>
		<s:else>
		Welcome, <a href="<s:url action="user/info" namespace="/" />">${sessionScope["lastname"]}</a>
		</s:else>
	</div>
	<div class="log">
		<s:if test="%{#session.lastname == null}">
			<span class="button"> <a href="<s:url action="loginpage" />">Sign
					In</a></span>
			<span class="button"> <a
				href="<s:url action="registerpage" />">Register</a>
			</span>
		</s:if>
		<s:else>
		
			<s:if test="%{#session.isAdmin == true}">
				<span class="button">
					<a href="<s:url action="admin/" namespace="/" />">Admin</a>
				</span>
			</s:if>
			
			<span class="button"> <a
				href="<s:url value="/j_spring_security_logout" />">Sign Out</a>
			</span>
		</s:else>
	</div>
	<div class="logo">
		<a href="<s:url action="index" namespace="/" />"><img src="<s:url value="/images/logo.png"/>"
			width="150" height="60" alt="Logo"></a>
	</div>
	<div class="search">
		<form name="frmSearch" action="<s:url action="category.action" namespace="/" />" method="GET" autocomplete="off">
			<input type="hidden" name="idCategory" value="search" />
			<input type="text" name="keySearch" id="st" maxlength="90" placeholder="search ..." autocomplete="off" style="z-index: 500; outline: none;">
			<button type="submit" id="sb">Go</button>
		</form>
	</div>
	<div class="cart">
		<s:if test="%{#session.cart == null}">
			<div
				style="float: right; margin: -10px 10px 0 0; font-size: 15px; font-weight: bold; color: #000; position: inherit">Total:
				0$</div>
			<div class="icon-cart">
				<a href="<s:url action="cart.action" namespace="/" ><s:param name="action">view</s:param></s:url>">
					<img src="<s:url value="/images/cart.png"/>" width="50px" height="50px" />
				</a>
			</div>
			<div class="item-cart">0</div>
		</s:if>
		<s:else>
			<div style="float: right; margin: -10px 10px 0 0; font-size: 15px; font-weight: bold; color: #000; position: inherit">Total:
				<s:property value="#session.cart.price" /></div>
			<div class="icon-cart">
				<a href="<s:url action="cart.action" namespace="/" ><s:param name="action">view</s:param></s:url>">
					<img src="<s:url value="/images/cart.png"/>" width="50px" height="50px" />
				</a>
			</div>
			<div class="item-cart"><s:property value="#session.cart.totalQuantity" /></div>
		</s:else>
	</div>
</div>
